add dependency_names
method to EasyConfig
class to get set of names of (direct) dependencies
#4360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is useful for determining if a feature or configure flag should be enabled. Especially as the pattern (getting the name out of
ec.dependencies()
) is used often already.I considered adding it to
EasyBlock
(at least additionally) which is possible but IMO doesn't provide much benefit given that it saves only 3 chars of typing ('.ec')I changed some tests to add testing or using this function which should be enough.
One "issue" is the handling of external modules which have a "name" of
None
. I currently filter them out. We could try reading['external_module_metadata'].get('name', [])
However that would be a change in behavior making a straight replacement of current usages risky and I'm also not sure how to correctly handle that:
external_module_metadata['name']
is a list. Should all be added?